<php>
    $name = ACTION_NAME;

</php>
<div class="mui-bar mui-bar-tab">
    <a  jump_url="{:U('Time/index')}" _class="a" <if condition="$name eq 'index'">class="mui-tab-item mui-active"<else/>class="mui-tab-item"</if> href="{:U('Time/index')}" ">
    <span class="mui-icon mui-icon-home"></span>
    <span  class="mui-tab-label">首页</span>
    </a>

    <a  jump_url="{:U('order/index1')}" _class="a"  <if condition="$name eq 'index1'">class="mui-tab-item mui-active"<else/>class="mui-tab-item"</if>>
        <span  class="mui-icon mui-icon-email"></span>
        <span  class="mui-tab-label">订单</span>
    </a>
    <a  jump_url="{:U('My/indexSet')}" _class="a"  <if condition="$name eq 'indexSet'">class="mui-tab-item mui-active"<else/>class="mui-tab-item"</if> href="{:U('My/indexSet')}" >
    <span    class="mui-icon mui-icon-contact"></span>
    <span   class="mui-tab-label">我的</span>
    </a>
</div>
<script>
   var  name = "<?php echo $name;?>";
    xunhuan = setInterval(function(){
        host = window.location.host;
        $('[_class="a"]').each(function()
        {
            if(name != 'index1')
            {
                //如果是选中状态
                if($(this).attr('class') == 'mui-tab-item mui-active')
                {
                    //比对跳转url 和当前url 是否相同
                    //不相同跳转
                    //跳转url
                    var url = 'http://'+host+$(this).attr('jump_url')
                    //alert(url)

                    //当前url
                    var durl = window.location.href;
                    //alert(durl)
                    if(url != durl)
                    {
                        clearInterval(xunhuan);
                        location.href = url

                    }
                }
            }


        })

    },100);


</script>